package com.shaoshaohuo.app.ui;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.shaoshaohuo.app.R;
import com.shaoshaohuo.app.net.ShopHttpConfig;
import com.shaoshaohuo.app.utils.im.IMFactory;

public class CheckFailActivity extends AppCompatActivity implements OnClickListener {
    /**
     * tobar
     */
    private ImageView order_tobar_back;
    private TextView order_tobar_enter;
    private ImageView order_tobar_right;
    private LinearLayout order_layout_topbar_left;
    private Button check_finish_btn;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_check_fail);
        initView();
    }

    private void initView() {
        /**
         * tobar
         * */
        order_tobar_back = (ImageView) findViewById(R.id.imageview_topbar_left_backImage);
        order_tobar_back.setVisibility(View.VISIBLE);
        order_tobar_back.setImageResource(R.mipmap.return_key);
        order_tobar_enter = (TextView) findViewById(R.id.toolbar_topname);
        order_tobar_enter.setText("商家入驻");
        order_tobar_right = (ImageView) findViewById(R.id.imageview_message);
        order_tobar_right.setImageResource(R.mipmap.shenhe_kefu);
        order_tobar_right.setVisibility(View.VISIBLE);
        order_layout_topbar_left = (LinearLayout) findViewById(R.id.layout_topbar_left);
        order_layout_topbar_left.setVisibility(View.VISIBLE);
        order_layout_topbar_left.setOnClickListener(this);
        order_tobar_right.setOnClickListener(this);

        check_finish_btn = (Button) findViewById(R.id.check_finish_btn);
        check_finish_btn.setOnClickListener(this);
        order_tobar_right.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                startActivity(ShopHttpConfig.phone());
            }
        });
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.imageview_message:
                IMFactory.openChatServiceContact(this);
                break;
            case R.id.layout_topbar_left:
                finish();
                break;
            case R.id.check_finish_btn:
                Intent intent = new Intent();
                intent.setClass(getApplicationContext(), BusinessApllyMessageActivity.class);
                startActivity(intent);
                break;
        }
    }
}
